home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1989 / Nov 89 / 0097-Re C++ destructors-Nov89 < prev    next >
Encoding:
Text File  |  1991-03-06  |  687 b   |  20 lines  |  [TEXT/GEOL]

  1. Item forwarded  by  A33          to A34
  2.  
  3. Item    8208938                         16-Nov-89        06:12
  4.  
  5. From:   PASCOE1                         Pascoe, Geoff
  6.  
  7. To:     MACAPP.TECH$                    MacApp Technical
  8.  
  9. Sub:    Re: C++ destructors
  10.  
  11. Although I don't use C++, I think the proper way of doing this would be to put
  12. all your initialization in the constructor and all your freeing-like behavior
  13. in the destructor.  Then, have I<MyClass> simply call the constructor and Free
  14. call the destructor.  That way you get the same behavior whether you allocate
  15. on the stack or on the heap.  Also, I would suggest you always make your
  16. constructors and destructors virtual.
  17.  
  18. Geoff
  19.  
  20.